package org.edu.modules.base.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.edu.modules.base.entity.VeBaseSysRole;
import org.edu.modules.base.mapper.VeBaseSysRoleMapper;
import org.edu.modules.base.service.IVeBaseSysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class VeBaseSysRoleServiceImpl extends ServiceImpl<VeBaseSysRoleMapper, VeBaseSysRole> implements IVeBaseSysRoleService {
    @Autowired
    private VeBaseSysRoleMapper veBaseSysRoleMapper;

    public VeBaseSysRole getModelByRoleText(String text) {
        return this.veBaseSysRoleMapper.getModelByRoleText(text);
    }

    @Override
    public VeBaseSysRole getModelByRoleCode(String code) {
        return this.veBaseSysRoleMapper.getModelByRoleCode(code);
    }

    public VeBaseSysRole getModelByIdAndText(Integer id, String text) {
        return this.veBaseSysRoleMapper.getModelByIdAndText(id, text);
    }

    public void deleteSysRoleUserById(String userId) {
        this.veBaseSysRoleMapper.deleteSysRoleUserById(userId);
    }

    public void addSysRoleUserById(String userId, String[] id) {
        this.veBaseSysRoleMapper.addSysRoleUserById(userId, id);
    }

    public int addSysRole(VeBaseSysRole veBaseSysRole) {
        return this.veBaseSysRoleMapper.addSysRole(veBaseSysRole);
    }

    public int getSysRoleAllList(VeBaseSysRole veBaseSysRole) {
        return this.veBaseSysRoleMapper.getSysRoleAllList(veBaseSysRole);
    }

    public List<Map<String, Object>> getSysRolePageList(VeBaseSysRole veBaseSysRole) {
        return this.veBaseSysRoleMapper.getSysRolePageList(veBaseSysRole);
    }
}
